<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:include href="core\common_templates.xsl"/>
<!-- 	<xsl:include href="core\layout_empty.xsl"/> -->
	<xsl:include href="core\level0.xsl"/>
	<xsl:include href="core\pager.xsl"/>
	<xsl:include href="core\form.xsl"/>
	<xsl:include href="register.xsl"/>
	<xsl:include href="vessel_lists_common.xsl"/>
	<xsl:include href="search_temlpate.xsl"/>

	<xsl:variable name="mode" select="/page/search_mode"/>

<xsl:template match="page">
	<xsl:call-template name="page_content"/>
</xsl:template>

	<xsl:template match="search">
		<strong>
			<font xsl:use-attribute-sets="f1" color="red"><xsl:value-of select="."/></font>
		</strong>
	</xsl:template>
	<xsl:template match="status">
		<strong>
			<font xsl:use-attribute-sets="f1" color="red"><xsl:value-of select="."/></font>
		</strong>
	</xsl:template>

	<xsl:template name="page_content">
		<xsl:choose>
			<xsl:when test="need_registring='1'">
				<xsl:apply-templates select="form[@name='register']"/>
			</xsl:when>
			<xsl:otherwise>
				<table cellpadding="4" cellspacing="1" width="100%" align="center">
					<xsl:choose>
						<xsl:when test="string-length(/page/autherror)>0">
							<tr><td><xsl:apply-templates select="autherror"/></td></tr>
						</xsl:when>
						<xsl:otherwise>
							<tr>
								<td>
									<xsl:call-template name="title_page">
										<xsl:with-param name="titleText">
											<xsl:if test="$mode='0'"><xsl:value-of select="//page/global_search_page_name"/><!-- General Search --></xsl:if>
											<xsl:if test="$mode='1'"><xsl:value-of select="//page/featured_vessels_page_name"/></xsl:if>
										</xsl:with-param>
									</xsl:call-template>
								</td>
							</tr>
						</xsl:otherwise>
					</xsl:choose>
					<tr><td><xsl:call-template name="main_content"/></td></tr>
				</table>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="main_content">
		<xsl:if test="not(check2)">
			<xsl:if test="check">
				<xsl:if test="count(rowset[@id='vessel_list_photo']/data/row)=0"><xsl:apply-templates select="./search"/></xsl:if>	
			</xsl:if>
		</xsl:if>	
		<xsl:if test="check2">
			<xsl:apply-templates select="./status"/><br/>
		</xsl:if>
		<xsl:if test="count(rowset[@id='vessel_list_photo']/data/row)=0">
			<xsl:apply-templates select="form"/><br/>
			<div style="font-size:10px; text-align:center;">
				The worldwide search is a tool to provide a comprehensive review of all vessels listed<br/>
				on the market and may include vessels centrally listed by other companies.
			</div>
		</xsl:if>
		<br/>	
		<xsl:if test="not(count(rowset[@id='vessel_list_photo']/data/row)=0)">
			<table width="100%" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>
						<xsl:apply-templates select="Pager/form"/>
						<xsl:apply-templates select="Pager"/>
					</td>
				</tr>
			</table>
		</xsl:if>
		<br/>
		<xsl:if test="not(count(rowset[@id='vessel_list_photo']/data/row)=0)">
			<xsl:call-template name="rowset"/>
		</xsl:if>
		<xsl:if test="not(count(rowset[@id='vessel_list_photo']/data/row)=0)">
			<table width="100%" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>
						<xsl:apply-templates select="Pager/form"/>
						<xsl:apply-templates select="Pager"/>
					</td>
				</tr>
			</table>
		</xsl:if>
		<br/>
	</xsl:template>

	<xsl:template match="form">
		<form>
				<xsl:copy-of select="@*"/>
				<xsl:apply-templates select="control/input[@type='hidden']"/>

			<table cellpadding="2" cellspacing="2" align="center">
				<tr>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
					<td class="titleblack" align="center" valign="top">
						<xsl:call-template name="general_part"/>
					</td>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
				</tr>
				<tr>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
					<td class="titleblack" align="center" valign="top">
						<!--<xsl:call-template name="display_part"/>-->
						<xsl:call-template name="location_part"/>
						<xsl:call-template name="sort_part"/>
					</td>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
				</tr>
				<tr>
					<td colspan="5" align="center">&#160;</td>
				</tr>
				<tr>
					<td colspan="5" align="center">
						<input type="Image" src="{$img_path_templates}/{$header_bg_color}/buttons/btn_submit.gif"/>
					</td>
				</tr>
			</table>
		</form>
	</xsl:template>

	<xsl:template match="title">
		<span><xsl:value-of select="."/></span>
	</xsl:template>
</xsl:stylesheet>
